home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1172 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.9 KB

  1. Date: Tue, 8 Mar 1994 19:50:57 -0500
  2. From: "Nicholas S Castellano" <entropy@terminator.rs.itd.umich.edu>
  3. To: herborth@53iss6.waterloo.ncr.com
  4. In-Reply-To: Chris Herborth's message of Tue, 8 Mar 1994 15:21:12 -0500 (EST) <9403081523.ac13487@ncrhub1.NCR.COM>
  5. Subject: another 1.10 job control bug?
  6.  
  7. >What you wrote:
  8. >> 
  9. >> > Just FYI...  Things don't seem to work they way we'd like 'em, even on
  10. >> > "real Unix".
  11. >> 
  12. >> On "real Unix" background jobs do not vanish on logout, but you are on
  13. >> Sys V. :-)   Seriously, there is a difference in behaviour between
  14. >> BSD and SysV based systems.  On BSD derivatives nohup does exist, but
  15. >> it is mostly supreflous besides of portability issues.  Come to think
  16. >> of it, I do not know how this is on SGI, which is a strange cross
  17. >> between BSD and SysV.
  18. >
  19. >Ah, but does POSIX say anything at all about this, uh, "feature" of SysV?
  20. >I suppose if it does, that'll be the deciding factor...
  21.  
  22. nohup is not superfluous.  Processes get SIGHUP signals on both SysV
  23. and BSD when the controlling tty is logged out (sometimes controllable
  24. by the CLOCAL and HUPCL modes in effect.)
  25.  
  26. I was only using daemons as an example of the problem I was
  27. describing; the problem is not unique to them.  Normally a daemon will
  28. assign a signal handler to SIGHUP, to mean "please re-read your
  29. configuration now".  So the SIGHUP generated by logging out is usually
  30. harmless, and you usually do NOT want to nohup a daemon (otherwise you
  31. won't be able to reconfigure it).  All this is entirely irrelevant.
  32.  
  33. What we're discussing is what happens to a process that thinks it
  34. still has a controlling tty once that tty has been logged out.  (or,
  35. more precisely, how to decide what "logging out a session" means under
  36. MiNT.  Once we decide what it means to log out, it should be trivial
  37. to do the right thing for those processes.)
  38.  
  39. Under SysV, processes are allowed to continue writing to the terminal
  40. if they have open file descriptors on it, but they stop receiving job
  41. control signals from the terminal.  Under BSD 4.2, the vhangup()
  42. routine in init revokes access to all open file descriptors on the
  43. controlling tty and further reads or writes return "invalid handle".
  44. Both behaviors are allowed by POSIX (although there is no vhangup()
  45. and the behavior may be slightly different, the general scheme
  46. permitted by POSIX is the same.)
  47.  
  48. My old routine definitely does have a bug...Juergen's patch (WITH THE
  49. FIX I SENT OUT A DAY OR SO AGO) works a bit better.  For now, it would
  50. be best to use that scheme, and perhaps modify getty slightly to take
  51. any strange cases into account:  the first thing it should do is
  52. "steal" the terminal from any existing processes that think they own
  53. it, by changing the process group of the terminal.
  54.  
  55. Ah, confusion...
  56. entropy
  57.  
  58. --
  59. entropy -- it's not just a good idea, it's the second law.
  60. Personal mail:      entropy@gnu.ai.mit.edu
  61. MiNT library mail:  entropy@terminator.rs.itd.umich.edu
  62. "what do you have against octal?" -jrb
  63.  
  64.